import request from '@/utils/request'
// -------------------------------面试技巧cmq----------------------------
// 获取列表数据
export const getarticleListAPI = params => {
  return request({
    url: '/articles',
    params
  })
}



// 增加文章
export const addarticleApi = data => {
  return request({
    url: '/articles',
    method: 'POST',
    data
  })
}

// 修改文章
export const getTageditApis = (data) => {
  return request({
    url: '/articles/'+data.id,
    method: 'put',
    data
  })
}
// 删除文章
export const delarticleInfoApi = (id) => {
  return request({
    url: '/articles/'+id,
    method:'delete',
  })
}
// 文章状态
export const articleInfoApi =(id,state) => {
  return request({
    url: `/articles/${id}/${state}`,
    method: 'POST',
  })
}

//文章详情
export const articleInfo = (id) => {
  return request({
    url: '/articles/'+id,
  })
}

